﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BigLotterySyndicate.Classes;
using SyndicateDAO.DatabaseObject;

namespace BigLotterySyndicate.Secured.Users.Controls
{
    public partial class Base : BaseUserControl
    {
        public int? UserId
        {
            get { return Request["uId"] != null ? Int32.Parse(Request["uId"].ToString()) : default(int?); }
        }

        
        public user CurrentUser
        {
            get
            {
                if (UserId.HasValue)
                    return this.BasePage.BusinessFacade.UserBL.GetSingleUser(this.UserId.Value);
                else
                    return default(user);
            }
        }

        #region print

        public string PrintUserId()
        {
            return this.CurrentUser.id.ToString();
        }

        public string PrintUserName()
        {
            return this.CurrentUser.username;
        }

        public string PrintUserEmail()
        {
            return this.CurrentUser.email;
        }

        public string PrintUserFunds()
        {
           return String.Format("&pound;{0}.00", this.CurrentUser.funds);
        }

        #endregion

    }
}